# $Id: PKGBUILD 89412 2013-04-29 10:56:56Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=proguard
pkgver=4.9
pkgrel=1
pkgdesc="free Java class file shrinker, optimizer, obfuscator, and preverifier"
arch=(any)
url="http://proguard.sourceforge.net/"
license=('GPL2')
depends=('java-runtime')
source=(http://downloads.sourceforge.net/proguard/proguard$pkgver.tar.gz)
md5sums=('95c652d7697aabee3b666c6ed8446457')

package() {
  cd "$srcdir/$pkgname$pkgver/lib"

  mkdir -p $pkgdir/usr/bin
  mkdir -p $pkgdir/usr/share/proguard
  install -D -m0644 proguardgui.jar proguard.jar retrace.jar $pkgdir/usr/share/proguard/

  cat >$pkgdir/usr/bin/proguardgui <<EOF
#!/bin/sh
exec java -jar /usr/share/proguard/proguardgui.jar \$*
EOF
  chmod 0755 $pkgdir/usr/bin/proguardgui

  cat >$pkgdir/usr/bin/proguard <<EOF
#!/bin/sh
exec java -jar /usr/share/proguard/proguard.jar \$*
EOF
  chmod 0755 $pkgdir/usr/bin/proguard
}
